(try_scrolling): Make sure `scroll-conservatively' is not too large before
authorJuanma Barranquero <lekktu@gmail.com>
Fri, 16 Apr 2004 19:32:23 +0000 (19:32 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Fri, 16 Apr 2004 19:32:23 +0000 (19:32 +0000)
computing how much to scroll.

src/xdisp.c

index b16331322144d7974a7f06e41684a836213241ea..2cd1d548457fce54d9ce16061cfff47bf2034663 100644 (file)
@@ -10879,6 +10879,12 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
   else
     this_scroll_margin = 0;
 
+  /* Force scroll_conservatively to have a reasonable value so it doesn't
+     cause an overflow while computing how much to scroll.  */
+  if (scroll_conservatively)
+    scroll_conservatively = min (scroll_conservatively,
+                                 MOST_POSITIVE_FIXNUM / FRAME_LINE_HEIGHT (f));
+
   /* Compute how much we should try to scroll maximally to bring point
      into view.  */
   if (scroll_step || scroll_conservatively || temp_scroll_step)